import java.util.ArrayList;
import java.util.Random;


public class Player {
	static final int N_MOVES = 10;
	
	private String name;
	private int score = 0;
	private ArrayList<RPSEnum> moves =  new ArrayList<RPSEnum>();
	private int iterator = 0;
	
	public Player(String n, ArrayList<RPSEnum> m){
		this.name = n;
		this.moves = m;
	}
	
	public Player(String n){
		this.name = n;
		this.moves =  new ArrayList<RPSEnum>();
		
		Random randomGenerator = new Random();
		int randomNumber;
		for(int i=0; i<N_MOVES; i++){
			randomNumber = randomGenerator.nextInt(3);
			if(randomNumber == 0){
				moves.add(RPSEnum.PAPER);
			}
			else if(randomNumber == 1){
				moves.add(RPSEnum.ROCK);
			}
			else{
				moves.add(RPSEnum.SCISSORS);
			}
		}
	}
	
	public String getName(){
		return this.name;
	}
	
	public int getScore(){
		return this.score;
	}
	
	public int getNmoves(){
		return this.N_MOVES;
	}
	
	public RPSEnum getNextMove(){
		RPSEnum res = moves.get(iterator);
		if(iterator < N_MOVES){
			iterator++;
		}
		return res;
	}
	
	public void setScore(int s){
		this.score = s;
	}
}
